<?php
namespace app\admin\controller;
/*
 *  用户列表
 * */
use app\common\controller\Admin;
use think\facade\View;
use app\common\model\AuthGroup;
use app\common\model\AuthGroupAccess;

class User extends Admin
{
    protected $modelClass = '\app\common\model\User';
    
    protected function setLang()
    {
        $this->searchArr = [
            'id' => lang('id'),
            'heco_address' => lang('heco_address'),
        ];
    }
    
    public function index()
    {
        $this->_indexSearch();
        $where = [];
        $getSearch = $this->_getSearch();
        if (!empty($getSearch)) $where[] = $getSearch;
        $order = 'id desc';
        $dataList = $this->cModel->where($where)->order($order)->paginate('', false, page_param());
        $sum_lp_amount = $this->cModel->where($where)->sum('lp_amount');
        $sum_token_amount = $this->cModel->where($where)->sum('token_amount');

        View::assign('sum_lp_amount', number_to_normal($sum_lp_amount,6));
        View::assign('sum_token_amount', number_to_normal($sum_token_amount,6));
        View::assign('dataList', $dataList);
        return View::fetch();
    }

}